package Apresentacao;

import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;

public final class Desktop {
    
    private static Desktop instance = new Desktop();
            
    private JDesktopPane desktopPane;

    private Desktop() {
        desktopPane = new JDesktopPane();
    }
    
    public static Desktop getInstance() {
        return instance;
    }

    public JDesktopPane getDesktopPane() {
        return desktopPane;
    }

    int x, y;
    
    public void show(JInternalFrame frame) {        
        desktopPane.add(frame);
        frame.setLocation(x, y);
        x += 20;
        y += 20;
        frame.setVisible(false);
        frame.setVisible(true);
        // violando LoD
        // desktopPane.getDesktopManager().activateFrame(frame);        
    }

}
